
for k,v in pairs(load_excel('技能数据.xlsx','物品技能')) do
    v.name = k
    v.skill_type = '物品技能'
    ac.lni('skill',k,v)
end



local mt = ac.skill['震撼打击']
mt.temp = '攻击触发'
mt.odds = 20
mt.data1 = 100

function mt:on_run(hero,target)
    local hero = self.owner
    local damage = hero:get('攻击') * self.data1 / 100
    local point = target:get_point()
    point:effect{
        model = ac.effect_model['震一下'],
        size = 1.5,
        time = 0.2,
    }
    hero:aoe_damage(target,300,damage,self)
end


local mt = ac.skill['散矢']
mt.temp = '攻击触发'
mt.odds = 20
mt.data1 = 100
--弹道模型
mt.missile_art = ac.effect_model['暗影箭']
mt.MissileArc = 0.15       --弹道弧度
mt.missile_speed = 1500   --弹道速度

function mt:on_run(hero,target)
    local hero = self.owner
    local group = ac.selector('unit'):range(hero,hero:get('攻击距离')):is_not(target):enemy(hero):get()
    local damage = hero:get('攻击') * self.data1 / 100
    local start = start or hero:get_launch_point()
    local model1 = hero:get_data('弹道模型') or hero:get_slk('Missileart')
    for _,unit in ipairs(table.random_table(group,12)) do
        ac.mover('target'){
            start = start,
            target = unit,
            model = model1,
            arc = self.MissileArc,
            speed = self.missile_speed,
            on_run = function()
                unit:damage{
                    source = hero,
                    damage = damage,
                    skill = self,
                }
            end
        }
    end
end


local mt = ac.skill['治愈']

function mt:on_add()
    local hero = self.owner
    self:gc(ac.loop(5*1000,function()
        if hero:is_alive() then
            hero:add_effect(ac.effect_model['回血特效'],'chest',1)
            hero:add('生命',hero:get('生命上限') * self.data1/100)
        end
    end))
end

